package cn.edu.cdu.argorithm.impl;

import cn.edu.cdu.argorithm.IBinaryTreeInorderTraversal;
import cn.edu.cdu.argorithm.common.TreeNode;

import java.util.ArrayList;
import java.util.List;

public class BinaryTreeInorderTraversal {
    public static class Solution1 implements IBinaryTreeInorderTraversal {
        @Override
        public List<Integer> inorderTraversal(TreeNode root) {
            List<Integer> res = new ArrayList<>();
            inorder(root, res);
            return res;
        }

        private void inorder(TreeNode root, List<Integer> res) {
            if(root == null) {
                return;
            }
            inorder(root.left, res);
            res.add(root.val);
            inorder(root.right, res);
        }
    }

    public static class Solution2 implements IBinaryTreeInorderTraversal {
        @Override
        public List<Integer> inorderTraversal(TreeNode root) {
            return null;
        }
    }

    public static class Solution3 implements IBinaryTreeInorderTraversal {
        @Override
        public List<Integer> inorderTraversal(TreeNode root) {
            return null;
        }
    }
}
